import request from '@/common/request.js'

const api = {}
// 登录
api.loginDo = params => request.globalRequest(`oauth/token`, 'POST', params, 1);
// 登录(获取openid)
api.wxGetOpenId = params => request.globalRequest(`miniApp/openId`, 'GET', params, 1);
// 登录(获取openid)
api.getWxBaseInfo = params => request.globalRequest(`getWxBaseInfo`, 'GET', params, 1);
/* 获取ticket */
api.getTicket = params => request.globalRequest(`oauth/ticket`, 'GET', params, 1);
/* 查询用户信息 */
api.getUser = params => request.globalRequest(`user/get`, 'GET', params, 1);
// 首页分类
api.homeTop = params => request.globalRequest(`room/tag/v2/top`, 'GET', params, 1);
// 首页推荐
api.homeRooms = params => request.globalRequest(`home/fun/rooms`, 'GET', params, 1);
// 首页根据标签查询
api.homeRoomsTag = params => request.globalRequest(`home/fun/tag/list`, 'GET', params, 1);
// 获取我的页面
api.getMine = params => request.globalRequest(`user/mine`, 'GET', params, 1);
// 获取用户个人资料
api.userDetail = params => request.globalRequest(`user/detail`, 'GET', params, 1);
// 验证用户是否可以设置性别
api.canSetGender = params => request.globalRequest(`user/v2/canSetGender`, 'POST', params, 1);
// 设置性别
api.setGender = params => request.globalRequest(`user/v2/setGender`, 'POST', params, 1);
// 待审核用户提交资料
api.updateUserContent = params => request.globalRequest(`user/v2/pending/content`, 'POST', params, 1);
// 查询用户钱包信息
api.getWallet = params => request.globalRequest(`purse/query`, 'GET', params, 1);
// 获取产品充值列表
api.getChargeprod = params => request.globalRequest(`chargeprod/list`, 'GET', params, 1);
// 用户搜索
api.searchUser = params => request.globalRequest(`search/v2/user`, 'GET', params, 1);
// 搜索房间
api.searchRoom = params => request.globalRequest(`search/v2/room`, 'GET', params, 1);
// 关注某人
api.focusAdd = params => request.globalRequest(`user/focus/add`, 'POST', params, 1);
// 取消关注某人
api.focusRemove = params => request.globalRequest(`user/focus/remove`, 'POST', params, 1);
// 开启青少年模式
api.adolescentOpen = params => request.globalRequest(`user/adolescent/open`, 'POST', params, 1);
// 关闭青少年模式
api.adolescentClose = params => request.globalRequest(`user/adolescent/close`, 'POST', params, 1);
// 微信支付
api.weChatMiniAppPay = params => request.globalRequest(`charge/v2/weChatMiniAppPay`, 'POST', params, 1);
// 获取礼物列表
api.getGiftList = params => request.globalRequest(`gift/list`, 'GET', params, 1);
// 获取用户背包
api.listUserBackpackV2 = params => request.globalRequest(`backpack/listUserBackpackV2`, 'GET', params, 1);
/* 获取房间信息 */
api.getRoom = params => request.globalRequest(`room/get`, 'GET', params, 1);
// 创建房间
api.roomOpen = params => request.globalRequest(`room/open`, 'POST', params, 1);
// 加入房间
api.userRoomIn = params => request.globalRequest(`userroom/in`, 'POST', params, 1);
//房间内获取用户信息
api.roomUserGet = params => request.globalRequest(`room/user/get`, 'GET', params, 1);
// 获取openId
api.getOpenId = params => request.globalRequest(`miniApp/openId`, 'GET', params, 1);
// 用户注册
api.setUser = params => request.globalRequest(`user/v2/miniApp/update`, 'POST', params, 1);
//上麦
api.upMic = params => request.globalRequest(`room/gift/value/up/mic`, 'POST', params, 1);
//下麦
api.downMic = params => request.globalRequest(`room/gift/value/down/mic`, 'POST', params, 1);
//获取房间所有麦序礼物值
api.valGet = params => request.globalRequest(`room/gift/value/get`, 'GET', params, 1);

// 更新用户信息
api.updateUser = params => request.globalRequest(`user/v2/update`, 'POST', params, 1);
// 填写邀请码
api.addInviter = params => request.globalRequest(`user/v2/miniApp/setChannel`, 'POST', params, 1);
// 兑换
api.goldExchange = params => request.globalRequest(`change/gold`, 'POST', params, 1);
// 收藏
api.favoriteAdd = params => request.globalRequest(`user/favorite/room/add`, 'POST', params, 1);
//取消收藏
api.favoriteRemove = params => request.globalRequest(`user/favorite/room/remove`, 'POST', params, 1);
//清除公屏
api.cleanScreen = params => request.globalRequest(`room/cleanScreen`, 'POST', params, 1);
//管理员设置密码
api.updateByAdmin = params => request.globalRequest(`room/updateByAdmin`, 'POST', params, 1);
//管理员设置密码
api.roomUpdate = params => request.globalRequest(`room/update`, 'POST', params, 1);

export default api